import Mock from 'mockjs'
import { MockList } from 'graphql-tools'
import Pick from './utils'

const { Random } = Mock

const rectangle = {
  description: Random.ctitle(3, 5),
  class_id: () => Pick(['苹果', '香蕉', '葡萄', '草莓']),
  interior: [],
  exterior: () => new MockList(2, () => new MockList(2)),
  tags: [],
}

const polygon = {
  description: Random.ctitle(3, 5),
  class_id: () => Pick(['梨', '金果', '柿子', '西瓜']),
  interior: () => new MockList([0, 3], () => new MockList([3, 10], () => new MockList(2))),
  exterior: () => new MockList([3, 5], () => new MockList(2)),
  tags: [],
}

export default () => Random.pick([rectangle, polygon])
